<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/style.css" />
    <script type="text/javascript" src="__JS__/jquery.js"></script>
    <script type="text/javascript" src="__JS__/jquery.sorted.js"></script>
    <script type="text/javascript" src="__JS__/bootstrap.js"></script>
    <script type="text/javascript" src="__JS__/ckform.js"></script>
    <script type="text/javascript" src="__JS__/common.js"></script>
   <script type="text/javascript">
    function getcity(){  
        var a = $("#pro").val();  
        $.post("/Admin/News/showcity?code="+a,{code: a},  
            function(data){  
                var obj = eval('('+data+')');
             
                $("#city").empty();  
                $("#city").prepend("<option value='-1'>请选择市</option>");           
                for(var p in obj){  
                    $("#city").append("<option value="+obj[p].code+">"+obj[p].name+"</option>");  
                      
                }  
            }  
        );    
    } 
    </script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form class="form-inline definewidth m20" action="/Admin/News/index" method="POST">  
    资讯名称：
    <input type="text" name="title" id="title" class="abc input-default" placeholder="" value="{$title}"/>&nbsp;&nbsp;
 资讯分类
 	<select name="sort">
 	<option  value = "0">全部</option>
 	<volist name="sort" id= "vo">
 	<if condition="$vo.id != $sortt">
 		<option  value = "{$vo.id}">{$vo.name}</option>
 		<else/>
 		<option  value = "{$vo.id}" selected="selected">{$vo.name}</option>
 	</if>
 	</volist>
 	<option  value = "-1">未分类</option>
 	</select>
 	
 	<select name="province" id="pro" onchange="getcity()">
		<option value="-1">请选择省</option>
		<volist name="data" id="v">
		<if condition="$v[code] != $prov">
		<option value="{$v[code]}">{$v['name']}</option>
		<else/>
		<option value="{$v[code]}" selected="selected">{$v['name']}</option>
		</if>
		</volist>
	</select>
		<select name="city" id="city">
			<option value="-1">请选择市</option>
			{$city}
		</select>     
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; <button type="button" class="btn btn-success" id="addnew">新增资讯</button>
</form>
<table class="table table-bordered table-hover definewidth m10" >
    <thead>
    <tr>
        
        <th>标题</th>
        <th>简介</th>
        <th>链接</th>      
        <th>分类</th>
        <th width="200">图片</th>
        <th>操作</th>
    </tr>
    </thead>
     <if condition = "count($news) != 0">
    <volist name="news" id="vo">
	     <tr>
            <td>{$vo.title}</td>
            <td >{$vo.profile}</td>
            <td >{$vo.url}</td>
            
            <td>{$vo.sort_name}</td>
            <td ><img src="/Uploads/{$vo.thumb_image}" style="width:200px;height:150px"/></td>           
            <td>
                  <a href="/Admin/News/edit?id={$vo.id}">编辑</a> | <a href="/Admin/News/delete?id={$vo.id}" onclick="return confirm('确认删除？删除后将无法复原！！！！')">删除</a>
                  
            </td>
        </tr>
     </volist>
     <else />
     <tr>
     <td colspan = '6'>
     <span>没有查找到数据</span>
     </td>
     </tr>
     </if>
      <tr><td colspan='10' >{$page}</td></tr>
      </table>
<div class="inline pull-right page">
</div>
</body>
</html>
<script>
    $(function () {
        
		$('#addnew').click(function(){

				window.location.href="/Admin/News/add";
		 });


    });

	function del(id)
	{
		
		
		if(confirm("确定要删除吗？"))
		{
		
			var url = "index.html";
			
			window.location.href=url;		
		
		}
	
	
	
	
	}
</script>